﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KPITemplate.aspx.cs" Inherits="KPI_SYSTEM.KPIPage.KPITemplate" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="../res/third-party/jqueryuiautocomplete/jquery-ui.css" />
    <style>
       
    </style>
</head>
<body style="overflow: -Scroll; overflow-x: hidden">

    <form id="form1" runat="server">
        <f:PageManager ID="PageManager1" runat="server" />
        <f:Form ID="Form2" IsFluid="true" CssClass="blockpanel" BodyPadding="5 5 0 5" LabelAlign="Left" ShowHeader="false"
            Title="查询" runat="server">
            <Rows>
                <f:FormRow ColumnWidths="15% 15% 15% 15% 15% 15%">
                    <Items>
                        <f:TextBox runat="server" ID="tbxNameSerach" Label="模板名称"></f:TextBox>
                        <f:Button ID="btnSearch" Text="搜索" Icon="Magnifier" runat="server" OnClick="btnSearch_Click"></f:Button>
                    </Items>
                    <Items>
                    </Items>
                </f:FormRow>
            </Rows>
        </f:Form>
        <f:Panel ID="Panel16" ShowHeader="false" CssClass="" ShowBorder="false" Layout="VBox" runat="server" AutoScroll="true">
            <Items>
                <f:Grid ID="Grid1" IsFluid="true" CssClass="blockpanel" ShowBorder="true" ShowHeader="true" Width="400px" EnableCollapse="false"
                    runat="server" DataKeyNames="REC_ID" AllowCellEditing="false" PageSize="15" AllowPaging="true" OnRowCommand="Grid1_RowCommand" OnPreRowDataBound="Grid1_PreRowDataBound"
                    DataIDField="REC_ID" Title="考核模板列表">
                    <Toolbars>
                        <f:Toolbar ID="Toolbar2" Position="Top" runat="server">
                            <Items>
                                <f:Button ID="btnNew" Text="新增" Icon="Add" EnablePostBack="false" runat="server">
                                    <Listeners>
                                        <f:Listener Event="click" Handler="onNewButtonClick" />
                                    </Listeners>
                                </f:Button>
                                <f:Button ID="btnEditDept" Text="编辑科室" Icon="House" EnablePostBack="true" EnableAjax="false" runat="server" OnClick="btnEditDept_Click">
                                </f:Button>
                                <f:Button ID="btnEditKPIValueItem" Text="编辑数值指标" Icon="TextListBullets" EnablePostBack="true" EnableAjax="false" runat="server" OnClick="btnEditKPIValueItem_Click">
                                </f:Button>
                                <f:Button ID="btnEditKPIScoreItem" Text="编辑评分指标" Icon="TextListBullets" EnablePostBack="true" EnableAjax="false" runat="server" OnClick="btnEditKPIScoreItem_Click">
                                </f:Button>
                                <f:Button ID="btnPreviewTemplate" Text="预览模板" Icon="Zoom" EnablePostBack="true" EnableAjax="false" runat="server" OnClick="btnPreviewTemplate_Click">
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <Columns>
                        <f:RenderField Width="150px" ColumnID="TEMPLATE_NAME" DataField="TEMPLATE_NAME"
                            HeaderText="模板名称">
                        </f:RenderField>
                        <f:RenderField Width="150px" ColumnID="TEMPLATE_CYCLE_NAME" DataField="TEMPLATE_CYCLE_NAME"
                            HeaderText="考核周期">
                        </f:RenderField>
                        <f:RenderField Width="150px" ColumnID="TEMPLATE_TYPE_NAME" DataField="TEMPLATE_TYPE_NAME"
                            HeaderText="考核方式">
                        </f:RenderField>
                        <f:RenderField Width="150px" ColumnID="TEMPLATE_STATUS_NAME" DataField="TEMPLATE_STATUS_NAME"
                            HeaderText="模板状态">
                        </f:RenderField>
                        <f:RenderField Width="300px" ColumnID="TEMPLATE_REMARK" DataField="TEMPLATE_REMARK"
                            HeaderText="模板备注">
                        </f:RenderField>
                        <f:RenderField Width="150px" Hidden="true" ColumnID="TEMPLATE_TYPE" DataField="TEMPLATE_TYPE"
                            HeaderText="考核方式ID">
                        </f:RenderField>
                        <f:RenderField Width="150px" Hidden="true" ColumnID="TEMPLATE_STATUS" DataField="TEMPLATE_STATUS"
                            HeaderText="模板状态ID">
                        </f:RenderField>
                        <f:RenderField Width="150px" Hidden="true" ColumnID="TEMPLATE_CYCLE" DataField="TEMPLATE_CYCLE"
                            HeaderText="考核周期ID">
                        </f:RenderField>
                        <f:LinkButtonField ColumnID="Edit" Width="50px" EnablePostBack="true" Icon="Pencil" />
                        <f:LinkButtonField Width="50px" ConfirmText="删除选中行？" ConfirmTarget="Top"
                            CommandName="Delete" Icon="Delete" />
                    </Columns>
                </f:Grid>

            </Items>
        </f:Panel>
        <f:Window ID="Window1" Title="新增模板" Hidden="true" EnableIFrame="false" AutoScroll="true"
            EnableMaximize="true" Target="Self" EnableResize="true" runat="server"
            IsModal="true" Width="650px">
            <Items>
                <f:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10px">
                    <Items>
                        <f:Panel ID="Panel1" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:HiddenField ID="hfFormID" runat="server"></f:HiddenField>
                                <f:TextBox ID="tbxFormTEMPLATE_NAME" runat="server" Width="310px" CssClass="marginr" Label="模板名称" ShowRedStar="true" Required="true">
                                </f:TextBox>
                                <f:DropDownList ID="ddlFormTEMPLATE_CYCLE" Width="310px" MarginLeft="20px" Label="考核周期" AutoSelectFirstItem="true" runat="server">
                                </f:DropDownList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel2" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:DropDownList ID="ddlFormTEMPLATE_TYPE" Width="310px" Label="考核方式" AutoSelectFirstItem="true" runat="server">
                                </f:DropDownList>
                                <f:DropDownList ID="ddlFormTEMPLATE_STATUS" Width="310px" MarginLeft="20px" Label="模板状态" AutoSelectFirstItem="true" runat="server">
                                    <f:ListItem Text="启用" Value="1" />
                                    <f:ListItem Text="停用" Value="0" />
                                </f:DropDownList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel4" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:TextBox ID="tbxFormTEMPLATE_REMARK" runat="server" CssClass="marginr" Label="模板备注">
                                </f:TextBox>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Toolbars>
                        <f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
                            <Items>
                                <f:Button ID="btnSave"
                                    Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1" OnClick="btnSave_Click">
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:SimpleForm>
            </Items>
        </f:Window>
        <f:Window ID="Window2" Title="编辑科室" Hidden="true" EnableIFrame="false" AutoScroll="true"
            EnableMaximize="true" Target="Self" EnableResize="true" runat="server"
            IsModal="true" Width="650px">
            <Items>
                <f:SimpleForm ID="SimpleForm2" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10px">
                    <Items>
                        <f:Panel ID="Panel3" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormCLINI_LIST" Label="临床科室" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel6" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormMEDICALSKILLS_LIST" Label="医技科室" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>

                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel5" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormEXECUTIVE_LIST" Label="行政科室" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Toolbars>
                        <f:Toolbar ID="Toolbar3" Position="Bottom" ToolbarAlign="Right" runat="server">
                            <Items>
                                <f:Label ID="Label1" CssStyle="color:red" runat="server"></f:Label>
                                <f:Button ID="btnSaveDept"
                                    Icon="SystemSave" runat="server" Text="保存" OnClick="btnSaveDept_Click">
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:SimpleForm>
            </Items>
        </f:Window>
        <f:Window ID="Window3" Title="编辑数值指标" Hidden="true" EnableIFrame="false" AutoScroll="true"
            EnableMaximize="true" Target="Self" EnableResize="true" runat="server"
            IsModal="true" Width="650px">
            <Items>
                <f:SimpleForm ID="SimpleForm3" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10px">
                    <Items>
                        <f:Panel ID="Panel7" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormVALUE_ITEM" Label="指标" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Toolbars>
                        <f:Toolbar ID="Toolbar4" Position="Bottom" ToolbarAlign="Right" runat="server">
                            <Items>
                                <f:Button ID="btnSaveValueItem"
                                    Icon="SystemSave" runat="server" Text="保存" OnClick="btnSaveValueItem_Click">
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:SimpleForm>
            </Items>
        </f:Window>
        <f:Window ID="Window4" Title="编辑评分指标" Hidden="true" EnableIFrame="false" AutoScroll="true"
            EnableMaximize="true" Target="Self" EnableResize="true" runat="server"
            IsModal="true" Width="650px">
            <Items>
                <f:SimpleForm ID="SimpleForm4" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10px">
                    <Items>
                        <f:Panel ID="Panel8" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormEfficiency" Label="效率效益" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel9" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormQuality" Label="质量安全" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel10" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormScience" Label="学科建设" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel11" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormSpecial" Label="专项工作" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Items>
                        <f:Panel ID="Panel12" ShowHeader="false" CssClass="" ShowBorder="false" Layout="Column" runat="server">
                            <Items>
                                <f:CheckBoxList ID="chlFormManage" Label="科室管理" ColumnNumber="3" ColumnVertical="true" runat="server">
                                </f:CheckBoxList>
                            </Items>
                        </f:Panel>
                    </Items>
                    <Toolbars>
                        <f:Toolbar ID="Toolbar5" Position="Bottom" ToolbarAlign="Right" runat="server">
                            <Items>
                                <f:Button ID="btnSaveScoreItem"
                                    Icon="SystemSave" runat="server" Text="保存" OnClick="btnSaveScoreItem_Click">
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:SimpleForm>
            </Items>
        </f:Window>
        <f:Window ID="Window5" Title="" Hidden="true" AutoScroll="true"
            EnableMaximize="true" Target="Self" EnableResize="true" runat="server"
            IsModal="true" Width="650px"  Maximized="true" >
            <Items>
                <f:Grid ID="Grid2" IsFluid="false" EnableColumnLines="true" CssClass="blockpanel" ShowBorder="true" ShowHeader="true"  EnableCollapse="false" runat="server" >
                    <Columns>
                      
                    </Columns>
                </f:Grid>
            </Items>
        </f:Window>
        <br />
        <br />
        <br />
    </form>
    <script src="../res/js/ApprovalButton.js"></script>
    <script>
        var windowClientID = '<%= Window1.ClientID %>';
        var gridClientID = '<%= Grid1.ClientID %>';
        var btnSaveClientID = '<%= btnSave.ClientID %>';
        var formClientID = '<%= SimpleForm1.ClientID %>';
        var hfFormIDClientID = '<%= hfFormID.ClientID %>';
        var tbxFormTEMPLATE_NAMEClientID = '<%= tbxFormTEMPLATE_NAME.ClientID %>';
        var ddlFormTEMPLATE_CYCLEClientID = '<%= ddlFormTEMPLATE_CYCLE.ClientID %>';
        var ddlFormTEMPLATE_TYPEClientID = '<%= ddlFormTEMPLATE_TYPE.ClientID %>';
        var ddlFormTEMPLATE_STATUSClientID = '<%= ddlFormTEMPLATE_STATUS.ClientID %>';
        var tbxFormTEMPLATE_REMARKClientID = '<%= tbxFormTEMPLATE_REMARK.ClientID %>';


        function onNewButtonClick(event) {
            // 重置表单字段
            F(formClientID).reset();
            F(hfFormIDClientID).setValue(null);
            // 弹出窗体
            F(windowClientID).show();
            F(windowClientID).setTitle('新增数据');
        }
        function onEditButtonClick(event) {
            showEditWindow();
        }
        function showEditWindow(rowId) {
            var grid = F(gridClientID);

            // 如果传入参数为空，则获取当前选中行
            if (!rowId) {
                var selectedRowIds = grid.getSelectedRows();
                if (!selectedRowIds.length) {
                    F.alert('请至少选择一项！');
                    return;
                }

                rowId = selectedRowIds[0];
            }
            F(windowClientID).setTitle('编辑数据');
            // 当前行数据
            var rowValue = grid.getRowValue(rowId);
            // 使用当前行数据填充表单字段
            F(hfFormIDClientID).setValue(rowId);
            F(tbxFormTEMPLATE_NAMEClientID).setValue(rowValue['TEMPLATE_NAME']);
            F(ddlFormTEMPLATE_CYCLEClientID).setValue(rowValue['TEMPLATE_CYCLE']);
            F(ddlFormTEMPLATE_TYPEClientID).setValue(rowValue['TEMPLATE_TYPE']);
            F(ddlFormTEMPLATE_STATUSClientID).setValue(rowValue['TEMPLATE_STATUS']);
            F(tbxFormTEMPLATE_REMARKClientID).setValue(rowValue['TEMPLATE_REMARK']);
            // 弹出新增窗体
            F(windowClientID).show();
        }
    </script>
</body>
</html>
